<? if(!defined('IN_ROOT')) exit('Access Denied'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"><? $user=$this->user; $setting=$this->setting; ?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Manyou's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=MY_CHARSET?>">
<link media="all" type="text/css" href="css/common/admin/admincp.css" rel="stylesheet"/>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jqueryui.js" type="text/javascript"></script>
<script src="js/admin.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#list").sortable({
update: function(){
var reorderid="";
var numValue=$("input[name='order[]']");
for(var i=0;i<numValue.length;i++){
reorderid+=$(numValue[i]).val()+",";
}
var hiddencid=$("input[name='hiddencid']").val();
$.post("index.php?admin_cate/reordersyscate<?=$setting['seo_suffix']?>",{order:reorderid,hiddencid:hiddencid});
}
});
});
</script>
</head>
<body>

<div class="container"><? if(isset($message)) { $type=isset($type)?$type:'correctmsg';  ?><div class="<?=$type?>"><p><?=$message?></p></div><? } ?><h3 class="marginbot">系统分类管理<a class="sgbtn" href="index.php?admin_cate<?=$setting['seo_suffix']?>">系统分类管理</a><a class="sgbtn" href="index.php?admin_cate/out<?=$setting['seo_suffix']?>">同业分类管理</a></h3>

<div class="mainbox nomargin">

<table class="opt">
<tr><? if($job=='edit') { ?><td><form name="askform" action="index.php?admin_cate<?=$setting['seo_suffix']?>" method="post"><input type="text" class="txt" name="catename" value="<?=$catedata['name']?>"/><select name="stype"><option value="1"<? if($catedata['type']==1) { ?> selected<? } ?>>单选</option><option value="2"<? if($catedata['type']==2) { ?> selected<? } ?>>多选</option><option value="3"<? if($catedata['type']==3) { ?> selected<? } ?>>下拉</option></select><select name="mid"><option value="0"<? if($catedata['mid']==0) { ?> selected<? } ?>>保留</option><option value="1"<? if($catedata['mid']==1) { ?> selected<? } ?>>不保留</option></select><input class="btn" tabindex="3" type="submit" value=" 编辑系统分类 " name="submit"><input type="hidden" value="editsave" name="job" /><input type="hidden" value="<?=$id?>" name="id"></form>&nbsp;&nbsp;</td><td><? } else { ?><td><form name="askform" action="index.php?admin_cate<?=$setting['seo_suffix']?>" method="post"><input type="text" class="txt" name="catename" /><select name="stype"><option value="1">单选</option><option value="2">多选</option><option value="3">下拉</option></select><select name="mid"><option value="0">保留</option><option value="1">不保留</option></select><input class="btn" tabindex="3" type="submit" value=" 添加系统分类 " name="submit"><input type="hidden" value="add" name="job" /></form>&nbsp;&nbsp;</td><td><? } ?><form name="askform" action="index.php?admin_cate<?=$setting['seo_suffix']?>" method="post">
&nbsp;&nbsp;上一级分类:<select name="cid">
<? if(is_array($catesys)) { foreach($catesys as $cate) { ?>
<option value="<?=$cate['id']?>"><?=$cate['name']?></option>
<? } } ?>
</select>分类名(一行一个):<textarea class="area" name="categorys"  style="height:30px;width:100px;" ></textarea><input class="btn" tabindex="3" type="submit" value=" 添加系统子分类 " name="submit"><input type="hidden" value="addcate" name="job" />
</form>
</td>
</tr>
</table>

</div>
<div class="mainbox">
<table width="80%" cellspacing="0" cellpadding="3" class="list">
<tr align="center" class="list_title">
<th width="50%" align="center"><strong>分类名称</strong></th>
<th  width="20%" align="center"><strong>子分类管理</strong></th>
<th  width="30%" align="center"><strong>编辑</strong></th>
</tr>    
</table>
    <input type="hidden" name="hiddencid" value="<?=$pid?>" />
<ul id="list" style="cursor: hand; cursor: pointer;" >
<? if(is_array($catesys)) { foreach($catesys as $cate) { ?>
<li style="list-style:none;">
<table width="80%"  class="list" id="table1">
<tr style="background:#f7f7f7">
<td width="50%" align="center"><a href="index.php?admin_cate/catelist/<?=$cate['id']?><?=$setting['seo_suffix']?>"><input name="order[]" type="hidden" value="<?=$cate['id']?>"/><strong><?=$cate['name']?></strong></a>(<? if($cate['type']==1) { ?>单选<? } elseif($cate['type']==2) { ?>多选<? } else { ?>下拉<? } ?>)(<? if($cate['mid']==0) { ?>保留<? } else { ?>不保留<? } ?>)</td>

<td width="20%" align="center"><a href="index.php?admin_cate/catelist/<?=$cate['id']?><?=$setting['seo_suffix']?>"><img src="<?=SITE_URL?>css/common/admin/view.png"></a></td>

<td width="30%" align="center"><a href="index.php?admin_cate/default/edit/<?=$cate['id']?><?=$setting['seo_suffix']?>"><img src="<?=SITE_URL?>css/common/admin/edit.png"></a><? if($cate['id']>4) { ?><a href="index.php?admin_cate/delsyscate/<?=$cate['id']?><?=$setting['seo_suffix']?>"><img src="<?=SITE_URL?>css/common/admin/remove.png"></a><? } ?></td>
</tr>
</table>
</li>
<? } } ?>
</ul>
</div>
</div>
</body>
</html>